#!/usr/bin/env python3
for i in range(1,10):
    for j in range(1,i+1):
        print(str(i)+'*'+str(j)+"="+str(i*j),end=" ")
    print()

print('='*60)

for i in range(9,0,-1):
    for j in range(1,i+1):
        print(str(i)+'*'+str(j)+"="+str(i*j),end=" ")
    print()

print('='*60)

for i in range(1,10):
    for j in range(9,0,-1):
        if j>i:
            print("       ",end="")
        else:
            print("{}*{}={:>2}".format(j,i,i*j),end=" ")
    print()

print('='*60)

for i in range(9,0,-1):
    for j in range(9,0,-1):
        if i<j:
            print("       ",end="")
        else:
            print("{}*{}={:>2}".format(j,i,i*j),end=" ")
    print()
